/**
 * 
 */
package com.vodafone.mapreduce.mrnode;

import org.apache.commons.cli.CommandLine;
import org.apache.commons.cli.Option;
import org.apache.commons.cli.Options;
import org.apache.commons.cli.ParseException;
import org.apache.commons.cli.PosixParser;

/**
 * @author rainer
 *
 */
public class MRNode {

	public static void main(String[] args) {
		try {
			MRNode mrNode = new MRNode();
			
			mrNode.handleCommandLineArguments(args);
		} catch(Exception e) {
			e.printStackTrace(System.err);
			
			System.exit(1);
		}
	}

	private String configurationFile;
	private String inputFile;
	private String outputFile;
	
	MRNode() {}
	
	void handleCommandLineArguments(String[] args) throws ParseException {
		Options options = new Options();
		Option option;
		
		option = new Option("c", "config-file", true, "path to node configuration tool");
		option.setRequired(true);
		options.addOption(option);

		option = new Option("i", "input-file", true, "optional input file");
		option.setRequired(false);
		options.addOption(option);

		option = new Option("o", "output-file", true, "optional output file");
		option.setRequired(false);
		options.addOption(option);
		
		PosixParser parser = new PosixParser();
		CommandLine line = parser.parse(options, args);
		
		this.configurationFile = line.getOptionValue("c");
		this.inputFile = line.getOptionValue("i");
		this.outputFile = line.getOptionValue("o");
	}
}
